package com.imay.live.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.imay.live.R;
import com.imay.live.model.UserModel;
import com.imay.live.utils.GlideUtil;

import java.util.List;

/**
 * Created by  nick on 2017/4/10 0010.
 * 个人页,推荐关注列表
 */

public class ProfileRecommendAdapter extends BaseQuickAdapter<UserModel,BaseViewHolder> {

    public ProfileRecommendAdapter( List data) {
        super(R.layout.item_recommend, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, UserModel item) {
        helper.setText(R.id.tv_recommend_user_name,item.getNick());
        helper.setText(R.id.tv_recommend_imay_number,String.format(mContext.getString(R.string.mine_room_id),item.getRoomId()));
        ImageView iv_profile_head_img = helper.getView(R.id.iv_recommend_head_img);
        GlideUtil.loadCircleImage(iv_profile_head_img,item.getImgHead(),R.mipmap.pnl_00_head108);
        helper.setText(R.id.btn_recommend_follow,item.isMyFollow()?R.string.has_followed:R.string.create_follow);
        helper.addOnClickListener(R.id.iv_recommend_head_img);
        helper.addOnClickListener(R.id.btn_recommend_follow);
        helper.addOnClickListener(R.id.tv_recommend_user_name);

    }


}
